<div class="movie-list">
    <div class="movie-header">
        <img src="/index/assets/icon/like.png" alt="">
        <h3 class="type-name">猜你喜欢</h3>
        <a class="more"><img src="/index/assets/icon/reload.png" alt="">换一换</a>
        <p class="clear-float"></p>
    </div>
    <ul class="rand-movie">
        {foreach $tuijian as $v }
        <li>
            <a href="{:url('movie/details',['id'=>$v['id']])}">
                <div>
                    <img src="{$img_path}{$v.image}" alt="">
                </div>
                <p>{$v.movie_name}</p>
            </a>
        </li>
        {/foreach}

    </ul>
</div>

<script>

    $('.more').click(function(){

        $.get('{:url("movie/randMovie")}','',function(res){
            if(res.code==200){

                var html = '';
                res.data.forEach(function(item,index,arr){
                    html += '  <li>\n' +
                        '            <a href="{:url(\'movie/details\')}?id='+item.id+'">\n' +
                        '                <div>\n' +
                        '                    <img src="{$img_path}'+item.image+'" alt="">\n' +
                        '                </div>\n' +
                        '                <p>'+item.movie_name+'</p>\n' +
                        '            </a>\n' +
                        '        </li>'
                })

                $('.rand-movie').html(html);
            }
        },'json')
    })
</script>